package com.cy2;

import com.cy1.FileOutputStreamDemo;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class CopyPictureDemo {
    public static void main(String[] args) throws IOException {
        FileOutputStream fos = new FileOutputStream("myByteStream\\sg.jpg");
        FileInputStream fis = new FileInputStream("C:\\Users\\CY\\Pictures\\Saved Pictures\\新建文件夹\\sg.jpg");
        byte[] bys=new byte[1024];
        int len;
        while((len=fis.read(bys))!=-1){
            fos.write(bys,0,len);
        }
        fis.close();
        fos.close();
    }
}
